package com.csun.cmny.provider.service.impl;

import com.csun.cmny.provider.dao.BedMapper;
import com.csun.cmny.provider.dao.OldmanMapper;
import com.csun.cmny.provider.service.OmcIndexHomeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chenzheng
 * @description:
 * @date 2019/7/26 15:00
 */
@Slf4j
@Service
public class OmcIndexHomeServiceImpl implements OmcIndexHomeService {

    @Resource
    private OldmanMapper oldmanMapper;

    @Resource
    private BedMapper bedMapper;

    /**
     * 在住老人、试住老人数量——首页
     * @param groupId  组织机构ID
     * @return
     */
    @Override
    public List<Integer> oldManNumberList(Long groupId) {
        return oldmanMapper.oldManNumberList(groupId);
    }

    /**
     * 今日预约（咨询）、今日试住、今日外出（请假）——首页
     * @param groupId 组织机构Id
     * @param thisDate
     * @return
     */
    @Override
    public List<Integer> todayList(Long groupId, String thisDate) {
        return oldmanMapper.todayList(groupId,thisDate);
    }

    /**
     * 院内床位、空余床位、已预订床位、院内房间——首页
     * @param groupId  组织机构ID
     * @return
     */
    @Override
    public List<Integer> bedNumberList(Long groupId) {
        return bedMapper.bedNumberList(groupId);
    }
}
